<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>jQuery File Upload Example</title>
<script src="js/jquery.1.9.1.min.js"></script>

<script src="js/vendor/jquery.ui.widget.js"></script>
<script src="js/jquery.iframe-transport.js"></script>
<script src="js/jquery.fileupload.js"></script>

<!-- bootstrap just to have good looking page -->
<script src="bootstrap/js/bootstrap.min.js"></script>
<link href="bootstrap/css/bootstrap.css" type="text/css"
	rel="stylesheet" />

<!-- we code these -->
<link href="css/dropzone.css" type="text/css" rel="stylesheet" />
<script src="js/myuploadfunction.js"></script>
<script src="js/jquery-ui-1.11.1/jquery-ui.js"></script>
<link href="js/jquery-ui-1.11.1/jquery-ui.css" rel="stylesheet">
</head>

<body>
	<h1>Spring MVC - jQuery File Upload</h1>

	<div id="dialog">
			<input id="fileupload" type="file" name="files[]" data-url="rest/controller/upload"
				multiple>

			<!-- <div id="dropzone" class="fade well">Drop files here</div> -->

			<div id="progress" class="progress">
				<div class="bar" style="width: 0%;"></div>
			</div>

			<table id="uploaded-files" class="table">
				<tr>
					<th>File Name</th>
					<th>File Size</th>
					<th>File Type</th>
					<th>Download</th>
				</tr>
			</table>
	</div>
	<p>
		<a href="#" id="dialog-link" class="ui-state-default ui-corner-all"><span
			class="ui-icon ui-icon-newwin"></span>Open Dialog</a>
	</p>

	<script type="text/javascript">
		$("#dialog").dialog({
			autoOpen : false,
			width : 700,
			buttons : [ {
				text : "Ok",
				click : function() {
					$(this).dialog("close");
				}
			}, {
				text : "Cancel",
				click : function() {
					$(this).dialog("close");
				}
			} ]
		});
		// Link to open the dialog
		$("#dialog-link").click(
				function(event) {
					$("#dialog").dialog("open");
					event.preventDefault();
					var myDate = new Date();
				/* 	$("#fileupload").attr(
							"data-url",
							"rest/controller/upload"); */
					//?channel="
									//+ myDate.getMilliseconds()
				});
	</script>
</body>
</html>
